package com.gzs.space.mapper;

import com.gzs.space.entity.FdfsFile;
import org.apache.ibatis.annotations.Delete;
import org.apache.ibatis.annotations.Insert;
import org.apache.ibatis.annotations.Select;

import java.util.List;

public interface UploadFileMapper {
	@Insert("insert into fdfs_file (id,file_name,group_name,new_file_name,create_time) values (#{id},#{fileName},#{groupName},#{newFileName},#{createTime})")
	int insert(FdfsFile fdfsFile);

	List<FdfsFile> findAll();

	@Delete("delete from fdfs_file where id = #{id}")
	boolean deleteFile(Integer id);

	@Select("select id,file_name as fileName,group_name as groupName," +
			"new_file_name as newFileName,create_time as createTime from fdfs_file where id = #{id}")
	FdfsFile findById(Integer id);
}
